a = [1]

N = 10 ** 18

while 1:
    b = []
    cur = 1
    for num in a:
        sq = int(num ** 0.5)
        for i in xrange(sq):
            b.append(cur)
            cur += 1
        b.append(num)
    a = b
    print len(b), max(b)

    if len(a) >= 6375958:
        print 'bingo'
        length = 0
        cur1 = 1
        cur2 = 1
        for num in a:
            sq = int(num ** 0.5)
            length += sq + 1
            if length >= N:
                break
        print length
        break


